{% extends "temple.html" %}
{% block property %}
class="active"
{% endblock %}
{% block connet %}
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h1 class="page-header">修改资产表信息</h1>
                <form action="" method="post" class="form-horizontal">
                {% csrf_token %}
                    <div class="form-group {% if error %}has-error{% endif %}">
                        <label for="a1" class="col-sm-2 col-sm-offset-2 control-label">物资名称:</label>
                        <div class="col-sm-4">
                            <input type="text" id="a1" class="form-control" value="{{ obj.P_name }}" name="p_name">
                            <span style="color: red">{{ error }}</span>
                        </div>

                    </div>
                    <div class="form-group">
                        <label for="a2" class="col-sm-2 col-sm-offset-2 control-label">物资描述</label>
                        <div class="col-sm-4">
                            <input type="text" id="a2" class="form-control" value="{{ obj.describe }}" name="describe">
                        </div>
                    </div>
                    <div class="form-group ">
                        <label for="a3" class="col-sm-2 col-sm-offset-2 control-label">购买时间:</label>
                        <div class="col-sm-4">
                            <input type="text" id="a3" class="form-control" value="{{ obj.times }}" name="times">
                        </div>
                    </div>
                <div class="form-group">
                <label for="a4" class="col-sm-2 col-sm-offset-2 control-label">购买人名称:</label>
                        <div class="col-sm-4">
                    <select  multiple name="abc" id="a4">
                        {% for foo in u_obj %}
                            {% if foo in obj.user.all %}
                                <option value="{{ foo.pk }}" selected>{{ foo.u_name }}</option>
                                {% else %}
                                <option value="{{ foo.pk }}">{{ foo.u_name }}</option>
                            {% endif %}
                        {% endfor %}
                     </select>
                    </div>
                </div>
                          <label for="a4" class="col-sm-2 col-sm-offset-2 control-label">所属实验室:</label>
                        <div class="col-sm-4">
                    <select  multiple name="labs" id="a4">
                        {% for foo in l_obj %}
                            {% if foo in obj.lab_set.all %}
                                <option value="{{ foo.pk }}" selected>{{ foo.l_name }}</option>
                                {% else %}
                                <option value="{{ foo.pk }}">{{ foo.l_name }}</option>
                            {% endif %}
                        {% endfor %}
                     </select>
                    </div>
                </div>





                    <button style="margin-left: 405px" class=" btn btn-primary">提交</button>

                </form>

        </div>
{% endblock %}











